package com.inspinia.upms.common.model.org;


import com.inspinia.base.common.model.NameCodeEnum;

/**
 * 资源类型
 * Created by veblen on 16-1-29.
 */
public enum UpmsOrgDeptVoType implements NameCodeEnum {

    org(1, "组织"), dept(2, "部门"), post(3, "岗位");

    private final int code;
    private final String name;

    UpmsOrgDeptVoType(int code, String name) {
        this.code = code;
        this.name = name;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public static UpmsOrgDeptVoType valueOf(int code) {
        for (UpmsOrgDeptVoType rs : UpmsOrgDeptVoType.values()) {
            if (rs.getCode() == code) {
                return rs;
            }
        }
        return null;
    }
}
